/**
 * @Author: 肖科
 * @Date: 2019/6/20
 * @Last Modified by:   肖科
 * @Last Modified time: 2019-09-07 09:45:00
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';


//保险公司下拉框
export const insuranceCompany = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/vehicle/insProposal/insCompany`, {
  params
});
//保险投保单查询
export const getInsurance = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/vehicle/insProposal/find`, {
  params
});
//保险顾问下拉框
export const insuranceService = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/vehicle/insProposal/insBroker`, {
  params
});
//跟踪人下拉框
export const trackPeople = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/vehicle/insProposal/trackPeople`, {
  params
});
//跟踪历史查询
export const historyQuery = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/vehicle/insProposal/trackHistory`, {
  params
});
//新增跟踪信息
export const addHistory = params => axios.post(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/vehicle/insProposal/addProposalTrack`, params);
//投保单退保
export const insuranceRemove= (id, params) => axios.post(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/vehicle/insProposal/update/${id}`, params);
//投保单完成
export const insuranceComplete = (id, params) => axios.post(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/vehicle/insProposal/updateStatus/${id}`, params);
//车主车辆查询
export const vehicleOwner = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/customerCare/ownerVehicleManagement/queryOwner`, {
  params
});

//投保单编辑和明细页面根据车主编号和车架号查询车主车辆信息
export const vehicleOwnerInformation = (ownerNo,vin,params) => axios.get(`${SERVER.DMSCLOUD_REPAIR}/customerCare/ownerVehicleManagement/queryOwnerInformation/${ownerNo}/${vin}`, {
  params
});
//查询活动卡卷
export const activityCard = (id, params) => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/vehicle/insProposal/Card/${id}`, {
  params
});
//投保单新增
export const addSave = params => axios.post(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/vehicle/insProposal/save`, params);
//投保单修改页面
export const editQuery = (id, params) => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/vehicle/insProposal/${id}`, {
  params
});
//投保单明细页面
export const detailedQuery = (id, params) => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/vehicle/insProposal/proposalCode/${id}`, {
  params
});
//导出
export const getExcelList = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/vehicle/insProposal/export`, {params ,responseType:'arraybuffer'});

//投保单修改保存
export const editSave = params => axios.post(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/vehicle/insProposal/modify/${params.PROPOSAL_CODE}`, params);
//投保单删除
export const deleteInsurance = (id, params) => axios.post(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/vehicle/insProposal/delete/${id}`, params);
//投保单新增险种查询
export const insuranceType = params => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/vehicle/insProposal/InsuranceType`, {
  params
});
// 品牌 - 下拉框
 export const getPinpSelect = params => axios.get(`/api/basedata/vehicleProduct/brandsqueryall`, { params})

// 车系 - 下拉框(根据品牌的id)
export const getChexSelect = (brandId, params) => axios.get(`/api/basedata/vehicleProduct/brandsdict/${brandId}/seriessdict`, {
  params
})

// 车型 - 下拉框()
export const getCheModelSelect = (brandsid, seriessid, params) => axios.get(`/api/basedata/vehicleProduct/brandsdict/${brandsid}/seriessdict/${seriessid}/modelsdict`, {
  params
})


